package cn.iocoder.yudao.module.book.controller.app.category.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "APP - 语言分类层级 Response VO")
@Data
public class AppLanguageCategoriesRespVO {

    @Schema(description = "大分类ID", example = "1")
    private Integer classifyId;

    @Schema(description = "大分类标题", example = "中文绘本")
    private String classifyTitle;

    @Schema(description = "分类列表")
    private List<CategoryInfo> categories;

    @Schema(description = "最近阅读（可选，作为一个虚拟分类返回）")
    private List<CollectionInfo> recentCollections;

    @Schema(description = "分类信息")
    @Data
    public static class CategoryInfo {
        @Schema(description = "分类ID", example = "1")
        private Integer categoryId;

        @Schema(description = "分类标题", example = "儿童故事")
        private String categoryTitle;

        @Schema(description = "绘本集合列表")
        private List<CollectionInfo> collections;
    }

    @Schema(description = "绘本集合信息")
    @Data
    public static class CollectionInfo {
        @Schema(description = "书本ID（最近阅读时返回）", example = "2")
        private Integer bookId;
        @Schema(description = "绘本集ID", example = "1")
        private Integer collectionId;

        @Schema(description = "绘本集标题", example = "小红帽")
        private String title;

        @Schema(description = "绘本集封面", example = "https://example.com/cover.jpg")
        private String image;

        @Schema(description = "绘本集描述", example = "经典童话故事")
        private String description;

        @Schema(description = "创作者", example = "张三")
        private String creator;

        @Schema(description = "是否为英文", example = "0")
        private Integer isEnglish;

        @Schema(description = "是否置顶", example = "0")
        private Integer isTop;

        @Schema(description = "创建时间")
        private LocalDateTime createTime;

        @Schema(description = "是否已添加到书架", example = "1")
        private Integer isInBookshelf;

        @Schema(description = "图书列表")
        private List<BookInfo> books;
    }

    @Schema(description = "图书信息")
    @Data
    public static class BookInfo {
        @Schema(description = "图书ID", example = "1")
        private Integer bookId;

        @Schema(description = "图书标题", example = "第一章")
        private String title;

        @Schema(description = "图书封面", example = "https://example.com/book1.jpg")
        private String image;

        @Schema(description = "图书顺序", example = "1")
        private Integer sort;

        @Schema(description = "创建时间")
        private LocalDateTime createTime;
    }
}
